<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<ui:composition template="/visao/templates/templateMovimentacao.xhtml">
	<ui:param name="pManagedBean" value="#{devolucaoBean}" />
	<ui:param name="pTituloForm"
		value="#{i18n['mov.nome']} #{i18n['devolucao.pagina.nome']}" />

	<ui:define name="titulo">
		<h:outputText value="#{i18n['mov.nome']} #{i18n['devolucao.nome']}" />
	</ui:define>

	<ui:define name="content">
		<script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/resources/js/jquery.maskMoney.js">
		</script>
		<script type="text/javascript">
			jQuery(function() {
				jQuery('input[id*=vlrFipe]').maskMoney({
					symbol : 'R$ ',
					showSymbol : true,
					thousands : '.',
					decimal : ',',
					symbolStay : true
				});

			});
		</script>
		<p:panel>
			<h:panelGrid columns="2" cellpadding="4">
				<h:outputText value="#{i18n['devolucao.matricula']}: " />
				<p:inputText value="#{pManagedBean.movimentacao.matricula}" style="width:300px"
					required="true" requiredMessage="#{i18n['requiredMessage']}"/>

				<h:outputText value="#{i18n['devolucao.atendente']}:" />
				<p:inputText value="#{pManagedBean.movimentacao.nomeAtendente}" style="width:300px" 
					required="true" requiredMessage="#{i18n['requiredMessage']}"/>

				<h:outputText value="#{i18n['devolucao.valorDevolucao']}: " />
				<p:inputText id="vlrFipe" value="#{pManagedBean.movimentacao.valor}" style="width:300px"
					converter="doubleConversor" />

				<h:outputText value="#{i18n['devolucao.observacao']}: " />
				<p:inputTextarea value="#{pManagedBean.movimentacao.descricao}" style="width:300px"
					required="true" requiredMessage="#{i18n['requiredMessage']}" />
			</h:panelGrid>

		</p:panel>
			<h:panelGrid columns="2" cellpadding="3" cellspacing="3">
				<p:commandButton icon="ui-icon-check"
					value="#{i18n['devolucao.button.confirma']}" ajax="false"
					action="#{devolucaoBean.doSalvar}" />
				<p:commandButton icon="ui-icon-circle-close"
					value="#{i18n['devolucao.button.sair']}" ajax="true"
					action="#{devolucaoBean.doCancelar}" immediate="true" />
			</h:panelGrid>
	</ui:define>
</ui:composition>
</html>